const { getAll } = require('../../utils/dbTools');
// 数据表名称
const tableName = 'banner';
/**
 * 获取轮播图列表
 * 
*/
const bannerList = async (req, res) => {
    const output = {
        code: 200,
        msg: '操作成功'
    }
    var { bus_id } = req.query;
    if (!bus_id) {
        bus_id=0;
    }
    const result = await getAll(tableName, { bus_id, status: 1 });
    if (!result) {
        output.code = 500;
        output.msg = "操作失败";
        return res.send(output);
    }
    output.data = result;
    res.send(output);
}


module.exports = {
    bannerList
}